package com.hsq.file_;

import java.io.FileWriter;
import java.io.IOException;

public class TestFileWriter {
    public static void main(String[] args) {
        String fileName = "D:\\git_turtle\\news1.txt";
        try{
            FileWriter writer = new FileWriter(fileName);
            writer.write("This is a text file, \n");
            writer.write("输入一行文字也可以\n");

            writer.close();
        }catch(IOException e){
            System.out.println("Problm writing " + fileName);
            e.toString();
        }

    }
}
